/**
 * task.h
 *
 * Copyright (C) 2007 Sadrul Habib Chowdhury <sadrul@pidgin.im>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 2 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#include <glib.h>

typedef enum
{
	G_URGENT_MEH     = -10,
	G_URGENT_NORMAL  = 0,
	G_URGENT_IMPORTANT = 10,
	G_URGENT_HIGH    = 100,
} GUrgency;

typedef struct _GTag
{
	char *name;
	GList *tasks;
} GTag;

typedef struct _GTask
{
	char *name;
	char *details;
	GUrgency urgency;
	GList *tags;
	gpointer uidata;
} GTask;

GTask *gt_task_new(const char *name, const char *details);

GTag *gt_tag_new(const char *name);

void gt_task_delete(GTask *task);

void gt_task_add_tag(GTask *task, GTag *tag);

void gt_task_remove_tag(GTask *task, GTag *tag);

gboolean gt_task_is_tagged(GTask *task, const char *tagname);

const GList * gt_tasks_get_all();

const GList * gt_tags_get_all();

void gt_tasks_set_homedir(const char *homedir);

void gt_tasks_load();

void gt_tasks_save(gboolean immediately);

void gt_tasks_read_all(const char *filename);

void gt_tasks_write_file(const char *filename);

void gt_task_add_tags_from_string(GTask *task, const char *text);

gint gt_task_compare(gconstpointer a, gconstpointer b);

